{% extends "base_cn.html" %}
{% block content %}
  {% if joingroup %}
    请选择你要加入的账本: 
  {% endif %}
  {% if allgroups %}
    你的所有账本: 
  {% endif %}
    <br/>
    {% include 'pager_cn.html' %}
    <table class="datalist" cellpadding="2" cellspacing="0">
    <tr>
      <th style="width:120px;"><span>名称</span></th>
      <th ><span>简介</span></th>
      <th style="width:100px;"><span>创建时间</span></th>
      <th style="width:100px;"><span>创建者</span></th>
      <th style="width:100px;"><span>操作</span></th>
    </tr>
    {% for group in grouplist %}
    <tr class={%if forloop.counter0|divisibleby:2 %}"alternation"{%else%}"seperation"{%endif%}>
      <td>
	
	{% if allgroups %}
	<a href='/summary/{{group.GroupName|escape}}'>
	{% endif %}
	{{group.GroupName|escape}}
	{% if allgroups %}
	</a>
	{% endif %}
	  </td>
      <td><span>{{group.Description|escape}}</span></td>
      <td>{{group.CreateDate|date:"Y-m-d"}}</td>
      <td><span>{{group.Owner.NickName|escape}}</span></td>
      <td>
      {% if joingroup %}
      <a href="/joingroup/{{group.GroupName|escape}}"> 申请加入</a>
      {% endif %}
  	  {% if allgroups %}
  	  <a href='/summary/{{group.GroupName|escape}}'>查看</a> | 
  	  <a href="/groupaction/quitgroup/{{group.GroupName|escape}}"> 退出</a>
  	  {% endif %}
      </td>
    </tr>
    {%endfor%}
    <tr><td colspan="5">
    {% include 'form_findgroup_cn.html' %}
    </td></tr>
    </table>
{% endblock %}
